﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using BPM.Base.WFLib.CustomerAttribute;
using BPM.Foundation.WFService;
using System.Collections.Generic;
using BPM.Foundation.WFDB;
using System.IO;
using System.Xml;
using BPM.Base.DataTypeLib;
using BPM.Base.Tools;
using System.Data;
using System.Text;

namespace BPM.Base.WFLib
{
    [System.Drawing.ToolboxBitmap(typeof(初始化), "pic.submit.png")]
    [ActivityValidator(typeof(WaitSubmitTemplateValidator))]
    [Designer(typeof(WaitSubmitDesigner), typeof(IDesigner))]
    public class 等待提交 : System.Workflow.Activities.HandleExternalEventActivity, IWaitSubmitTemplate
    {

        #region 1 基本信息
        //-[1.1 状态编号]

        [DescriptionAttribute("工作流模板的编号")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 状态编号
        {
            get
            {
                return this.Name;
            }

        }
        //--

        //-[1.2 状态名称]
        public static DependencyProperty 状态名称Property = DependencyProperty.Register("状态名称", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("工作流模板的编号")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 状态名称
        {
            get
            {
                return ((string)(base.GetValue(等待提交.状态名称Property)));
            }
            set
            {
                base.SetValue(等待提交.状态名称Property, value);
            }
        }
        //--

        //-[1.3 状态说明]
        public static DependencyProperty 状态说明Property = DependencyProperty.Register("状态说明", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("工作流模板的编号")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 状态说明
        {
            get
            {
                return ((string)(base.GetValue(等待提交.状态说明Property)));
            }
            set
            {
                base.SetValue(等待提交.状态说明Property, value);
            }
        }
        //--

        //-[1.4 处理方式]
        private string _处理方式 = "";

        [DescriptionAttribute("工作流模板的编号")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_处理方式), typeof(System.Drawing.Design.UITypeEditor))]
        public string 处理方式
        {
            get
            {
                return _处理方式;
            }
            set
            {
                _处理方式 = value;
            }
        }
        //--

        //-[1.5 权限编号]
        public static DependencyProperty 权限编号Property = DependencyProperty.Register("权限编号", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 权限编号
        {
            get
            {
                return ((string)(base.GetValue(等待提交.权限编号Property)));
            }
            set
            {
                base.SetValue(等待提交.权限编号Property, value);
            }
        }
        //--

        //-[1.6 扩展数据]
        public static DependencyProperty 扩展数据Property = DependencyProperty.Register("扩展数据", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("01.基本信息")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 扩展数据
        {
            get
            {
                return ((string)(base.GetValue(等待提交.扩展数据Property)));
            }
            set
            {
                base.SetValue(等待提交.扩展数据Property, value);
            }
        }
        //--
        #endregion

        #region 2 表单配置

        //-[2.1 启动窗体]
        public static DependencyProperty 启动窗体Property = DependencyProperty.Register("启动窗体", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("02.表单配置")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 启动窗体
        {
            get
            {
                return ((string)(base.GetValue(等待提交.启动窗体Property)));
            }
            set
            {
                base.SetValue(等待提交.启动窗体Property, value);
            }
        }
        //--

        //-[2.2 数据表单类型]
        public static DependencyProperty 数据表单类型Property = DependencyProperty.Register("数据表单类型", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("02.表单配置")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 数据表单类型
        {
            get
            {
                return ((string)(base.GetValue(等待提交.数据表单类型Property)));
            }
            set
            {
                base.SetValue(等待提交.数据表单类型Property, value);
            }
        }
        //--

        //-[2.3 数据分流表达式]
        public static DependencyProperty 数据分流表达式Property = DependencyProperty.Register("数据分流表达式", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("02.表单配置")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 数据分流表达式
        {
            get
            {
                return ((string)(base.GetValue(等待提交.数据分流表达式Property)));
            }
            set
            {
                base.SetValue(等待提交.数据分流表达式Property, value);
            }
        }
        //--


        #endregion

        #region 3 办理权限
        //-[3.1 办理人员]
        public static DependencyProperty 办理人员Property = DependencyProperty.Register("办理人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 办理人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.办理人员Property)));
            }
            set
            {
                base.SetValue(等待提交.办理人员Property, value);
            }
        }
        //--

        //-[3.2 办理时特殊权限]
        private string _办理时特殊权限 = "";
        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_办理时特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 办理时特殊权限
        {
            get
            {
                return _办理时特殊权限;
            }
            set
            {
                _办理时特殊权限 = value;
            }
        }
        //--

        //-[3.3 办理时限]
        public static DependencyProperty 办理时限Property = DependencyProperty.Register("办理时限", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 办理时限
        {
            get
            {
                return ((int)(base.GetValue(等待提交.办理时限Property)));
            }
            set
            {
                base.SetValue(等待提交.办理时限Property, value);
            }
        }
        //--

        //-[3.4 办理超时操作]
        public static DependencyProperty 办理超时操作Property = DependencyProperty.Register("办理超时操作", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 办理超时操作
        {
            get
            {
                return ((string)(base.GetValue(等待提交.办理超时操作Property)));
            }
            set
            {
                base.SetValue(等待提交.办理超时操作Property, value);
            }
        }
        //--

        //-[3.5 办理提交选项]
        private string _办理提交选项 = "提交";
        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_办理提交选项), typeof(System.Drawing.Design.UITypeEditor))]
        public string 办理提交选项
        {
            get
            {
                return _办理提交选项;
            }
            set
            {
                _办理提交选项 = value;
            }
        }
        //--

        //-[3.6 办理查看业务表单]
        public static DependencyProperty 办理查看业务表单Property = DependencyProperty.Register("办理查看业务表单", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]

        public string 办理查看业务表单
        {
            get
            {
                return ((string)(base.GetValue(等待提交.办理查看业务表单Property)));
            }
            set
            {
                base.SetValue(等待提交.办理查看业务表单Property, value);
            }
        }
        //--

        //-[3.7 办理添写业务表单]
        public static DependencyProperty 办理添写业务表单Property = DependencyProperty.Register("办理添写业务表单", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("03.办理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 办理添写业务表单
        {
            get
            {
                return ((string)(base.GetValue(等待提交.办理添写业务表单Property)));
            }
            set
            {
                base.SetValue(等待提交.办理添写业务表单Property, value);
            }
        }
        //--
        #endregion

        #region 4 接件权限
        //-[4.1 接件部门]
        public static DependencyProperty 接件部门Property = DependencyProperty.Register("接件部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("04.接件权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 接件部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.接件部门Property)));
            }
            set
            {
                base.SetValue(等待提交.接件部门Property, value);
            }
        }
        //--

        //-[4.2 接件职能]
        public static DependencyProperty 接件职能Property = DependencyProperty.Register("接件职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("04.接件权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 接件职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.接件职能Property)));
            }
            set
            {
                base.SetValue(等待提交.接件职能Property, value);
            }
        }
        //--

        //-[4.3 接件时特殊权限]

        private string _接件时特殊权限 = "";
        [DescriptionAttribute("")]
        [CategoryAttribute("04.接件权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_接件时特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 接件时特殊权限
        {
            get
            {
                return _接件时特殊权限;
            }
            set
            {
                _接件时特殊权限 = value;
            }
        }
        //--

        //-[4.4 接件时限]
        public static DependencyProperty 接件时限Property = DependencyProperty.Register("接件时限", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("04.接件权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 接件时限
        {
            get
            {
                return ((int)(base.GetValue(等待提交.接件时限Property)));
            }
            set
            {
                base.SetValue(等待提交.接件时限Property, value);
            }
        }
        //--
        //-[4.5 接件超时操作]
        public static DependencyProperty 接件超时操作Property = DependencyProperty.Register("接件超时操作", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("04.接件权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 接件超时操作
        {
            get
            {
                return ((string)(base.GetValue(等待提交.接件超时操作Property)));
            }
            set
            {
                base.SetValue(等待提交.接件超时操作Property, value);
            }
        }
        //--
        #endregion

        #region 5 分配权限
        //-[5.1 分配部门]
        public static DependencyProperty 分配部门Property = DependencyProperty.Register("分配部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 分配部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.分配部门Property)));
            }
            set
            {
                base.SetValue(等待提交.分配部门Property, value);
            }
        }
        //--

        //-[5.2 分配职能]
        public static DependencyProperty 分配职能Property = DependencyProperty.Register("分配职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 分配职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.分配职能Property)));
            }
            set
            {
                base.SetValue(等待提交.分配职能Property, value);
            }
        }
        //--

        //-[5.3 分配人员]
        public static DependencyProperty 分配人员Property = DependencyProperty.Register("分配人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 分配人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.分配人员Property)));
            }
            set
            {
                base.SetValue(等待提交.分配人员Property, value);
            }
        }
        //--

        //-[5.4 分配时特殊权限]
        private string _分配时特殊权限 = "";

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_分配时特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 分配时特殊权限
        {
            get
            {
                return _分配时特殊权限;
            }
            set
            {
                _分配时特殊权限 = value;
            }
        }
        //--

        //-[5.5 分配时限]
        public static DependencyProperty 分配时限Property = DependencyProperty.Register("分配时限", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 分配时限
        {
            get
            {
                return ((int)(base.GetValue(等待提交.分配时限Property)));
            }
            set
            {
                base.SetValue(等待提交.分配时限Property, value);
            }
        }
        //--

        //-[5.5 分配超时操作]
        public static DependencyProperty 分配超时操作Property = DependencyProperty.Register("分配超时操作", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("05.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 分配超时操作
        {
            get
            {
                return ((string)(base.GetValue(等待提交.分配超时操作Property)));
            }
            set
            {
                base.SetValue(等待提交.分配超时操作Property, value);
            }
        }
        //--

        #endregion

        #region 6. 管理权限
        //-[6.1管理部门]
        public static DependencyProperty 管理部门Property = DependencyProperty.Register("管理部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("06.管理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 管理部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.管理部门Property)));
            }
            set
            {
                base.SetValue(等待提交.管理部门Property, value);
            }
        }
        //--

        //-[6.2 管理职能]
        public static DependencyProperty 管理职能Property = DependencyProperty.Register("管理职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("06.管理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 管理职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.管理职能Property)));
            }
            set
            {
                base.SetValue(等待提交.管理职能Property, value);
            }
        }
        //--

        //-[6.3 管理人员]
        public static DependencyProperty 管理人员Property = DependencyProperty.Register("管理人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("06.管理权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 管理人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.管理人员Property)));
            }
            set
            {
                base.SetValue(等待提交.管理人员Property, value);
            }
        }
        //--

        //-[6.4 管理时特殊权限]

        private string _管理时特殊权限 = "";
        [DescriptionAttribute("")]
        [CategoryAttribute("06.管理权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_管理时特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 管理时特殊权限
        {
            get
            {
                return _管理时特殊权限;
            }
            set
            {
                _管理时特殊权限 = value;
            }
        }
        //--

        #endregion

        #region 7.查看权限

        //-[7.1 查看部门]
        public static DependencyProperty 查看部门Property = DependencyProperty.Register("查看部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("07.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 查看部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.查看部门Property)));
            }
            set
            {
                base.SetValue(等待提交.查看部门Property, value);
            }
        }
        //--

        //-[7.2 查看职能]
        public static DependencyProperty 查看职能Property = DependencyProperty.Register("查看职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("07.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 查看职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.查看职能Property)));
            }
            set
            {
                base.SetValue(等待提交.查看职能Property, value);
            }
        }
        //--

        //-[7.3 查看人员]
        public static DependencyProperty 查看人员Property = DependencyProperty.Register("查看人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("07.分配权限")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 查看人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.查看人员Property)));
            }
            set
            {
                base.SetValue(等待提交.查看人员Property, value);
            }
        }
        //--

        //-[7.4 查看时特殊权限]
        private string _查看时特殊权限 = "";

        [DescriptionAttribute("")]
        [CategoryAttribute("07.分配权限")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_查看时特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 查看时特殊权限
        {
            get { return _查看时特殊权限; }
            set { _查看时特殊权限 = value; }
        }
        //--


        #endregion

        #region 8 动态域
        //-[8.1 动态域部门]
        public static DependencyProperty 动态域部门Property = DependencyProperty.Register("动态域部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 动态域部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.动态域部门Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域部门Property, value);
            }
        }
        //--

        //-[8.2 动态域职能]
        public static DependencyProperty 动态域职能Property = DependencyProperty.Register("动态域职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 动态域职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.动态域职能Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域职能Property, value);
            }
        }
        //--

        //-[8.3 动态域人员]
        public static DependencyProperty 动态域人员Property = DependencyProperty.Register("动态域人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 动态域人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.动态域人员Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域人员Property, value);
            }
        }
        //--

        //-[8.4 动态域特殊权限]
        public static DependencyProperty 动态域特殊权限Property = DependencyProperty.Register("动态域特殊权限", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 动态域特殊权限
        {
            get
            {
                return ((string)(base.GetValue(等待提交.动态域特殊权限Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域特殊权限Property, value);
            }
        }
        //--

        //-[8.5 动态域时限]
        public static DependencyProperty 动态域时限Property = DependencyProperty.Register("动态域时限", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 动态域时限
        {
            get
            {
                return ((int)(base.GetValue(等待提交.动态域时限Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域时限Property, value);
            }
        }
        //--

        //-[8.6 动态域类型]
        public static DependencyProperty 动态域类型Property = DependencyProperty.Register("动态域类型", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("08.动态域")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 动态域类型
        {
            get
            {
                return ((string)(base.GetValue(等待提交.动态域类型Property)));
            }
            set
            {
                base.SetValue(等待提交.动态域类型Property, value);
            }
        }
        //--
        #endregion

        #region  9 提交上下文
        //-[9.1. 提交人员特殊权限]
        string _提交人员特殊权限 = "";

        [DescriptionAttribute("")]
        [CategoryAttribute("09.提交上下文")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_提交人员特殊权限), typeof(System.Drawing.Design.UITypeEditor))]
        public string 提交人员特殊权限
        {
            get
            {
                return _提交人员特殊权限;
            }
            set
            {
                _提交人员特殊权限 = value;
            }
        }
        //--

        //-[9.2 提交次数]
        public static DependencyProperty 提交次数Property = DependencyProperty.Register("提交次数", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("09.提交上下文")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 提交次数
        {
            get
            {
                return ((int)(base.GetValue(等待提交.提交次数Property)));
            }
            set
            {
                base.SetValue(等待提交.提交次数Property, value);
            }
        }
        //--

        //-[9.3 前一状态实例编号]
        public static DependencyProperty 前一状态实例编号Property = DependencyProperty.Register("前一状态实例编号", typeof(Guid), typeof(等待提交), new PropertyMetadata(Guid.Empty));

        [DescriptionAttribute("")]
        [CategoryAttribute("09.提交上下文")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public Guid 前一状态实例编号
        {
            get
            {
                return ((Guid)(base.GetValue(等待提交.前一状态实例编号Property)));
            }
            set
            {
                base.SetValue(等待提交.前一状态实例编号Property, value);
            }
        }
        //--
        #endregion

        #region 10 提交

        //-[10.1. 提交结果]
        public static DependencyProperty 提交结果Property = DependencyProperty.Register("提交结果", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 提交结果
        {
            get
            {
                return ((string)(base.GetValue(等待提交.提交结果Property)));
            }
            set
            {
                base.SetValue(等待提交.提交结果Property, value);
            }
        }
        //--

        //-[10.2 提交人员]
        public static DependencyProperty 提交人员Property = DependencyProperty.Register("提交人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 提交人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.提交人员Property)));
            }
            set
            {
                base.SetValue(等待提交.提交人员Property, value);
            }
        }
        //--

        //-[10.3 提交部门]
        public static DependencyProperty 提交部门Property = DependencyProperty.Register("提交部门", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 提交部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.提交部门Property)));
            }
            set
            {
                base.SetValue(等待提交.提交部门Property, value);
            }
        }
        //--

        //-[10.4 提交职能]
        public static DependencyProperty 提交职能Property = DependencyProperty.Register("提交职能", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 提交职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.提交职能Property)));
            }
            set
            {
                base.SetValue(等待提交.提交职能Property, value);
            }
        }
        //--

        //-[10.5 提交日期]
        public static DependencyProperty 提交日期Property = DependencyProperty.Register("提交日期", typeof(DateTime), typeof(等待提交), new PropertyMetadata(new DateTime(1900, 1, 1)));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public DateTime 提交日期
        {
            get
            {
                return ((DateTime)(base.GetValue(等待提交.提交日期Property)));
            }
            set
            {
                base.SetValue(等待提交.提交日期Property, value);
            }
        }
        //--

        //-[10.6 提交方式]
        private string _提交方式 = "";

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [EditorAttribute(typeof(等待提交_提交方式), typeof(System.Drawing.Design.UITypeEditor))]
        public string 提交方式
        {
            get
            {
                return _提交方式;
            }
            set
            {
                _提交方式 = value;
            }
        }
        //--

        //-[10.7 提交说明]
        public static DependencyProperty 提交说明Property = DependencyProperty.Register("提交说明", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 提交说明
        {
            get
            {
                return ((string)(base.GetValue(等待提交.提交说明Property)));
            }
            set
            {
                base.SetValue(等待提交.提交说明Property, value);
            }
        }
        //--
        //-[10.8 触发器类型]
        public static DependencyProperty 触发器类型Property = DependencyProperty.Register("触发器类型", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 触发器类型
        {
            get
            {
                return ((string)(base.GetValue(等待提交.触发器类型Property)));
            }
            set
            {
                base.SetValue(等待提交.触发器类型Property, value);
            }
        }
        //--

        //-[10.9 下一状态办理人员]
        public static DependencyProperty 下一状态办理人员Property = DependencyProperty.Register("下一状态办理人员", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 下一状态办理人员
        {
            get
            {
                return ((string)(base.GetValue(等待提交.下一状态办理人员Property)));
            }
            set
            {
                base.SetValue(等待提交.下一状态办理人员Property, value);
            }
        }
        //--

        //-[10.10 数据表单]
        public static DependencyProperty 数据表单Property = DependencyProperty.Register("数据表单", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 数据表单
        {
            get
            {
                return ((string)(base.GetValue(等待提交.数据表单Property)));
            }
            set
            {
                base.SetValue(等待提交.数据表单Property, value);
            }
        }
        //--

        public static DependencyProperty 下一状态办理时限Property = DependencyProperty.Register("下一状态办理时限", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 下一状态办理时限
        {
            get
            {
                return ((int)(base.GetValue(等待提交.下一状态办理时限Property)));
            }
            set
            {
                base.SetValue(等待提交.下一状态办理时限Property, value);
            }
        }

        public static DependencyProperty 下一状态接件部门Property = DependencyProperty.Register("下一状态接件部门", typeof(string), typeof(等待提交), new PropertyMetadata(0));
        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 下一状态接件部门
        {
            get
            {
                return ((string)(base.GetValue(等待提交.下一状态接件部门Property)));
            }
            set
            {
                base.SetValue(等待提交.下一状态接件部门Property, value);
            }
        }

        public static DependencyProperty 下一状态接件职能Property = DependencyProperty.Register("下一状态接件职能", typeof(string), typeof(等待提交), new PropertyMetadata(0));
        [DescriptionAttribute("")]
        [CategoryAttribute("10.提交")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 下一状态接件职能
        {
            get
            {
                return ((string)(base.GetValue(等待提交.下一状态接件职能Property)));
            }
            set
            {
                base.SetValue(等待提交.下一状态接件职能Property, value);
            }
        }
        #endregion

        #region 11 数据中转
        //-[11.1. 状态实例编号]
        public static DependencyProperty 状态实例编号Property = DependencyProperty.Register("状态实例编号", typeof(Guid), typeof(等待提交), new PropertyMetadata(Guid.Empty));

        [DescriptionAttribute("")]
        [CategoryAttribute("11.数据中转")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public Guid 状态实例编号
        {
            get
            {
                return ((Guid)(base.GetValue(等待提交.状态实例编号Property)));
            }
            set
            {
                base.SetValue(等待提交.状态实例编号Property, value);
            }
        }
        //--

        //-[11.2 上下文数据]
        public static DependencyProperty 上下文数据Property = DependencyProperty.Register("上下文数据", typeof(string), typeof(等待提交));

        [DescriptionAttribute("")]
        [CategoryAttribute("11.数据中转")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 上下文数据
        {
            get
            {
                return ((string)(base.GetValue(等待提交.上下文数据Property)));
            }
            set
            {
                base.SetValue(等待提交.上下文数据Property, value);
            }
        }
        //--
        #endregion

        #region 12 调试测试
        //-[12.1 调试器]
        public static DependencyProperty 调试器Property = DependencyProperty.Register("调试器", typeof(string), typeof(等待提交), new PropertyMetadata(""));

        [DescriptionAttribute("")]
        [CategoryAttribute("12.调试测试")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public string 调试器
        {
            get
            {
                return ((string)(base.GetValue(等待提交.调试器Property)));
            }
            set
            {
                base.SetValue(等待提交.调试器Property, value);
            }
        }
        //--

        //-[12.2 状态跟踪器]
        public static DependencyProperty 状态跟踪器Property = DependencyProperty.Register("状态跟踪器", typeof(int), typeof(等待提交), new PropertyMetadata(0));

        [DescriptionAttribute("")]
        [CategoryAttribute("12.调试测试")]
        [BrowsableAttribute(true)]
        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        public int 状态跟踪器
        {
            get
            {
                return ((int)(base.GetValue(等待提交.状态跟踪器Property)));
            }
            set
            {
                base.SetValue(等待提交.状态跟踪器Property, value);
            }
        }

        //--
        #endregion

        public 等待提交()
        {
            InitializeComponent();
        }

        //[2.4.1]
        ITemplate Root()
        {
            Activity o = this.Parent;

            while (o.Parent != null)
            {
                o = o.Parent;
            }
            ITemplate tp = o as ITemplate;

            if (tp != null)
            {
                return tp;
            }
            else
            {
                throw new System.Exception("GetRoot");
            }

        }

        //[2.4.2]
        [System.Diagnostics.DebuggerNonUserCode]
        private void InitializeComponent()
        {
            //[1 指定外部触发接口]
            this.EventName = "submitEvent";

            this.InterfaceType = typeof(BPM.Base.WFLib.IExternalEvent);

            //[2 触发完成后的事件]
            this.Invoked += new EventHandler<ExternalDataEventArgs>(EndNotify);

        }

        //[2.4.3]
        protected override void OnActivityExecutionContextLoad(IServiceProvider provider)
        {
            //[1 调用基方法]
            base.OnActivityExecutionContextLoad(provider);
            //[2 如果 状态跟踪器 是1则执行]
            if (Root().状态跟踪器 == 1)
            {
                //[3 初始化 状态实例编号]
                this.状态实例编号 = Guid.NewGuid();
                //[4 向外发送通知]
                WorkflowService service = provider.GetService(typeof(WorkflowService)) as WorkflowService;
                if (service != null)
                {
                    #region 处理等待提交参数
                    if (!string.IsNullOrEmpty(this.上下文数据))
                    {
                        StringReader stream = null;
                        XmlTextReader reader = null;
                        DataForm myDataForm = new DataForm();
                        //把数据表单字符串读取到StringReader
                        stream = new StringReader(this.上下文数据);
                        //从stream装载到XmlTextReader
                        reader = new XmlTextReader(stream);
                        //把xmlTextReader 读到 dataSet
                        try
                        {
                            myDataForm.ReadXml(reader);
                        }
                        catch
                        {
                            myDataForm = null;
                        }
                        //判断转化后的dataset是否为空
                        if (myDataForm != null)
                        {
                            if (myDataForm.waitSubmitTab != null)
                            {
                                DataForm.waitSubmitTabRow myWaitSubmit = myDataForm.waitSubmitTab.FirstOrDefault();
                                if (myWaitSubmit != null)
                                {
                                    #region 按提交过来waitSubmitTab 设置属性
                                    //分配
                                    if (myWaitSubmit.IsassignDepartmentNull() == false && myWaitSubmit.assignDepartment != null && myWaitSubmit.assignDepartment != "none")
                                    {
                                        this.分配部门 = myWaitSubmit.assignDepartment;
                                    }
                                    if (myWaitSubmit.IsassignDutyNull() == false && myWaitSubmit.assignDuty != null && myWaitSubmit.assignDuty != "none")
                                    {
                                        this.分配职能 = myWaitSubmit.assignDuty;
                                    }

                                    if (myWaitSubmit.IsassignOvertimeOperateNull() == false && myWaitSubmit.assignOvertimeOperate != null && myWaitSubmit.assignOvertimeOperate != "none")
                                    {
                                        this.分配超时操作 = myWaitSubmit.assignOvertimeOperate;
                                    }
                                    if (myWaitSubmit.IsassignPowerNull() == false && myWaitSubmit.assignPower != null && myWaitSubmit.assignPower != "none")
                                    {
                                        this.分配时特殊权限 = myWaitSubmit.assignPower;
                                    }
                                    if (myWaitSubmit.IsassignTimelimitNull() == false && myWaitSubmit.assignTimelimit != -1)
                                    {
                                        this.分配时限 = myWaitSubmit.assignTimelimit;
                                    }

                                    if (myWaitSubmit.IsassignUserNull() == false && myWaitSubmit.assignUser != null && myWaitSubmit.assignUser != "none")
                                    {
                                        this.分配人员 = myWaitSubmit.assignUser;
                                    }



                                    //接件
                                    if (myWaitSubmit.IsinceptDepartmentNull() == false && myWaitSubmit.inceptDepartment != null && myWaitSubmit.inceptDepartment != "none")
                                    {
                                        this.接件部门 = myWaitSubmit.inceptDepartment;
                                    }

                                    if (myWaitSubmit.IsinceptDutyNull() == false && myWaitSubmit.inceptDuty != null && myWaitSubmit.inceptDuty != "none")
                                    {
                                        this.接件职能 = myWaitSubmit.inceptDuty;
                                    }

                                    if (myWaitSubmit.IsinceptOvertimeOperateNull() == false && myWaitSubmit.inceptOvertimeOperate != null && myWaitSubmit.inceptOvertimeOperate != "none")
                                    {
                                        this.接件超时操作 = myWaitSubmit.inceptOvertimeOperate;
                                    }

                                    if (myWaitSubmit.IsinceptPowerNull() == false && myWaitSubmit.inceptPower != null && myWaitSubmit.inceptPower != "none")
                                    {
                                        this.接件时特殊权限 = myWaitSubmit.inceptPower;
                                    }

                                    if (!myWaitSubmit.IsinceptTimelimitNull() && myWaitSubmit.inceptTimelimit != -1)
                                    {
                                        this.接件时限 = myWaitSubmit.inceptTimelimit;
                                    }


                                    //管理
                                    if (!myWaitSubmit.IsmanageDepartmentNull() && myWaitSubmit.manageDepartment != null && myWaitSubmit.manageDepartment != "none")
                                    {
                                        this.管理部门 = myWaitSubmit.manageDepartment;
                                    }

                                    if (!myWaitSubmit.IsmanageDutyNull() && myWaitSubmit.manageDuty != null && myWaitSubmit.manageDuty != "none")
                                    {
                                        this.管理职能 = myWaitSubmit.manageDuty;
                                    }
                                    if (!myWaitSubmit.IsmanagePowerNull() && myWaitSubmit.managePower != null && myWaitSubmit.managePower != "none")
                                    {
                                        this.管理时特殊权限 = myWaitSubmit.managePower;
                                    }

                                    if (!myWaitSubmit.IsmanageUserNull() && myWaitSubmit.manageUser != null && myWaitSubmit.manageUser != "none")
                                    {
                                        this.管理人员 = myWaitSubmit.manageUser;
                                    }

                                    //查看
                                    if (!myWaitSubmit.IsseeDepartmentNull() && myWaitSubmit.seeDepartment != null && myWaitSubmit.seeDepartment != "none")
                                    {
                                        this.查看部门 = myWaitSubmit.seeDepartment;
                                    }
                                    if (!myWaitSubmit.IsseeDutyNull() && myWaitSubmit.seeDuty != null && myWaitSubmit.seeDuty != "none")
                                    {
                                        this.查看职能 = myWaitSubmit.seeDuty;
                                    }

                                    if (!myWaitSubmit.IsseePowerNull() && myWaitSubmit.seePower != null && myWaitSubmit.seePower != "none")
                                    {
                                        this.查看时特殊权限 = myWaitSubmit.seePower;
                                    }

                                    if (!myWaitSubmit.IsseeUserNull() && myWaitSubmit.seeUser != null && myWaitSubmit.seeUser != "none")
                                    {
                                        this.查看人员 = myWaitSubmit.seeUser;
                                    }

                                    //办理
                                    if (!myWaitSubmit.IstransactOptionNull() && myWaitSubmit.transactOption != null && myWaitSubmit.transactOption != "none")
                                    {
                                        this.办理提交选项 = myWaitSubmit.transactOption;
                                    }

                                    if (!myWaitSubmit.IstransactOvertimeOperateNull() && myWaitSubmit.transactOvertimeOperate != null && myWaitSubmit.transactOvertimeOperate != "none")
                                    {
                                        this.办理超时操作 = myWaitSubmit.transactOvertimeOperate;
                                    }

                                    if (!myWaitSubmit.IstransactPowerNull() && myWaitSubmit.transactPower != null && myWaitSubmit.transactPower != "none")
                                    {
                                        this.办理时特殊权限 = myWaitSubmit.transactPower;
                                    }

                                    if (!myWaitSubmit.IstransactSeeFormNull() && myWaitSubmit.transactSeeForm != null && myWaitSubmit.transactSeeForm != "none")
                                    {
                                        this.办理查看业务表单 = myWaitSubmit.transactSeeForm;
                                    }

                                    if (!myWaitSubmit.IstransactTimelimitNull() && myWaitSubmit.transactTimelimit != -1)
                                    {
                                        this.办理时限 = myWaitSubmit.transactTimelimit;
                                    }

                                    if (!myWaitSubmit.IstransactUserNull() && myWaitSubmit.transactUser != null && myWaitSubmit.transactUser != "none")
                                    {
                                        this.办理人员 = myWaitSubmit.transactUser;
                                    }

                                    if (!myWaitSubmit.IstransactWriteFormNull() && myWaitSubmit.transactWriteForm != null && myWaitSubmit.transactWriteForm != "none")
                                    {
                                        this.办理添写业务表单 = myWaitSubmit.transactWriteForm;
                                    }

                                    #endregion
                                }

                            }
                        }
                    }
                    #endregion
                    service.beforeWFWaited("", this, this.WorkflowInstanceId);
                }
                else
                {
                    List<string> ls = provider.GetService(typeof(List<string>)) as List<string>;
                    if (ls != null)
                    {
                        ls.Add("--------------------------等待提交-----------------------------------");

                        ls.Add("办理查看业务表单:" + this.办理查看业务表单.ToString());
                        ls.Add("办理超时操作:" + this.办理超时操作.ToString());
                        ls.Add("办理人员:" + this.办理人员.ToString());
                        ls.Add("办理时特殊权限:" + this.办理时特殊权限.ToString());
                        ls.Add("办理时限:" + this.办理时限.ToString());
                        ls.Add("办理提交选项:" + this.办理提交选项.ToString());
                        ls.Add("办理添写业务表单:" + this.办理添写业务表单.ToString());
                        ls.Add("查看部门:" + this.查看部门.ToString());
                        ls.Add("查看人员:" + this.查看人员.ToString());
                        ls.Add("查看时特殊权限:" + this.查看时特殊权限.ToString());
                        ls.Add("查看职能:" + this.查看职能.ToString());
                        ls.Add("处理方式:" + this.处理方式.ToString());
                        ls.Add("触发器类型:" + this.触发器类型.ToString());
                        ls.Add("调试器:" + this.调试器.ToString());
                        ls.Add("动态域部门:" + this.动态域部门.ToString());
                        ls.Add("动态域类型:" + this.动态域类型.ToString());
                        ls.Add("动态域人员:" + this.动态域人员.ToString());
                        ls.Add("动态域时限:" + this.动态域时限.ToString());
                        ls.Add("动态域特殊权限:" + this.动态域特殊权限.ToString());
                        ls.Add("动态域职能:" + this.动态域职能.ToString());
                        ls.Add("分配部门:" + this.分配部门.ToString());
                        ls.Add("分配超时操作:" + this.分配超时操作.ToString());
                        ls.Add("分配人员:" + this.分配人员.ToString());
                        ls.Add("分配时特殊权限:" + this.分配时特殊权限.ToString());
                        ls.Add("分配时限:" + this.分配时限.ToString());
                        ls.Add("分配职能:" + this.分配职能.ToString());
                        ls.Add("管理部门:" + this.管理部门.ToString());
                        ls.Add("管理人员:" + this.管理人员.ToString());
                        ls.Add("管理时特殊权限:" + this.管理时特殊权限.ToString());
                        ls.Add("管理职能:" + this.管理职能.ToString());
                        ls.Add("接件部门:" + this.接件部门.ToString());
                        ls.Add("接件超时操作:" + this.接件超时操作.ToString());
                        ls.Add("接件时特殊权限:" + this.接件时特殊权限.ToString());
                        ls.Add("接件时限:" + this.接件时限.ToString());
                        ls.Add("接件职能:" + this.接件职能.ToString());
                        ls.Add("扩展数据:" + this.扩展数据.ToString());
                        ls.Add("启动窗体:" + this.启动窗体.ToString());
                        ls.Add("前一状态实例编号:" + this.前一状态实例编号.ToString());
                        ls.Add("权限编号:" + this.权限编号.ToString());

                        ls.Add("数据表单:" + this.数据表单.ToString());
                        ls.Add("数据表单类型:" + this.数据表单类型.ToString());
                        ls.Add("数据分流表达式:" + this.数据分流表达式.ToString());
                        ls.Add("提交部门:" + this.提交部门.ToString());
                        ls.Add("提交次数:" + this.提交次数.ToString());
                        ls.Add("提交方式:" + this.提交方式.ToString());
                        ls.Add("提交结果:" + this.提交结果.ToString());
                        ls.Add("提交人员:" + this.提交人员.ToString());
                        ls.Add("提交人员特殊权限:" + this.提交人员特殊权限.ToString());
                        ls.Add("提交日期:" + this.提交日期.ToString());
                        ls.Add("提交说明:" + this.提交说明.ToString());
                        ls.Add("提交职能:" + this.提交职能.ToString());
                        ls.Add("下一状态办理人员:" + this.下一状态办理人员.ToString());
                        ls.Add("状态编号:" + this.状态编号.ToString());
                        ls.Add("状态跟踪器:" + this.状态跟踪器.ToString());
                        ls.Add("状态名称:" + this.状态名称.ToString());
                        ls.Add("状态实例编号:" + this.状态实例编号.ToString());
                        ls.Add("状态说明:" + this.状态说明.ToString());

                    }

                }

                //[5 状态跟踪器 设为 0 ]
                Root().状态跟踪器 = 0;
            }

        }

        //[2.4.4]
        void EndNotify(object sender, ExternalDataEventArgs e)
        {
            SubmitEventArgs input = e as SubmitEventArgs;

            //[1 接收触发参数]
            this.提交结果 = input.提交结果;
            this.提交人员 = input.提交人员;
            this.提交部门 = input.提交部门;
            this.提交职能 = input.提交职能;
            this.提交日期 = System.DateTime.Now;
            this.提交方式 = input.提交方式;
            this.提交说明 = input.提交说明;
            this.触发器类型 = input.触发器类型;

            this.下一状态办理人员 = input.下一状态办理人员;
            this.下一状态办理时限 = input.下一状态办理时限;
            this.下一状态接件部门 = input.下一状态接件部门;
            this.下一状态接件职能 = input.下一状态接件职能;
            
            #region 给等待提交的数据表单赋值

            this.数据表单 = input.数据表单;


            #endregion

            //[2 设置数据中转变量]
            Root().当前节点提交结果 = input.提交结果;
            Root().当前节点提交人员 = input.提交人员;
            Root().状态编号 = input.状态实例编号.ToString();
            if (!string.IsNullOrEmpty(input.下一状态办理人员) && input.下一状态办理人员 != "none")
            {
                Root().下一状态办理人员 = input.下一状态办理人员;
            }
            if (!string.IsNullOrEmpty(input.下一状态接件部门) && input.下一状态接件部门 != "none")
            {
                Root().下一状态接件部门 = input.下一状态接件部门;
            }
            if (!string.IsNullOrEmpty(input.下一状态接件职能) && input.下一状态接件职能 != "none")
            {
                Root().下一状态接件职能 = input.下一状态接件职能;
            }

            //[3 状态跟踪器 设为 1]
            Root().状态跟踪器 = 1;

        }

        //[2.4.5]
        protected override void OnClosed(IServiceProvider provider)
        {

            //[1 向外发送通知]
            WorkflowService service = provider.GetService(typeof(WorkflowService)) as WorkflowService;
            if (service != null)
            {
                service.afterWFWaited("", this, this.WorkflowInstanceId);
            }
            else
            {
                List<string> ls = provider.GetService(typeof(List<string>)) as List<string>;

                ls.Add("--------------------------提交-----------------------------------");
                ls.Add("流程编号:" + Root().流程编号.ToString());
                ls.Add("状态实例编号:" + this.状态实例编号);
                ls.Add("状态名称:" + this.状态名称);
                ls.Add("提交部门:" + this.提交部门);
                ls.Add("提交职能:" + this.提交职能);
                ls.Add("提交人员:" + this.提交人员);
                ls.Add("提交结果:" + this.提交结果);
                ls.Add("");

            }
            //[end]
            base.OnClosed(provider);
        }


        // 把DataSet 转化为 字符串
        private string convertDataSetToString(DataSet xmlDS)
        {
            MemoryStream stream = null;
            XmlTextWriter writer = null;

            try
            {
                stream = new MemoryStream();
                //从stream装载到XmlTextReader

                writer = new XmlTextWriter(stream, Encoding.UTF8);

                //用WriteXml方法写入文件.

                xmlDS.WriteXml(writer);
                int count = (int)stream.Length;
                byte[] arr = new byte[count];
                stream.Seek(0, SeekOrigin.Begin);
                stream.Read(arr, 0, count);

                UTF8Encoding utf8 = new UTF8Encoding();
                return utf8.GetString(arr).Trim();
            }
            catch (System.Exception ex)
            {

                MyLog.writeError(ex.Message);
                return "";
            }
            finally
            {
                if (writer != null)
                    writer.Close();
            }

        }

    }


}
